package com.xinqi.modules.stats.score.controller.down;

import com.xinqi.modules.stats.score.dto.req.CourseTotalScoreOfflineStudentQueryDTO;
import com.xinqi.modules.stats.score.dto.req.CourseTotalScoreStudentQueryDTO;
import com.xinqi.modules.stats.score.service.CourseTotalScoreOfflineService;
import com.xinqi.modules.stats.score.service.CourseTotalScoreService;
import com.xinqi.modules.stats.score.service.CourseTotalScoreTypeService;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletResponse;

/**
 * 成绩管理下载
 * @param
 * @return
 */
@Tag(name = "成绩管理下载", description = "成绩管理下载")
@Controller
@RequestMapping("/down/total-score")
@RequiredArgsConstructor
public class CourseTotalScoreDownController {

    private final CourseTotalScoreTypeService courseTotalScoreTypeService;

    private final CourseTotalScoreService courseTotalScoreService;

    private final CourseTotalScoreOfflineService courseTotalScoreOfflineService;

    /**
     * 老师端总成绩成绩下载
     * @param dto
     * @return
     */
    @GetMapping("/total")
    public void totalScore(CourseTotalScoreStudentQueryDTO dto, HttpServletResponse response) {
        courseTotalScoreService.downTotalExcel(dto, response);
    }

    /**
     * 老师端分类成绩下载
     * @param dto
     * @return
     */
    @GetMapping("/type")
    public void typeScore(CourseTotalScoreStudentQueryDTO dto, HttpServletResponse response) {
        courseTotalScoreTypeService.downExcel(dto, response);
    }

    /**
     * 老师端线下成绩瞎子啊
     * @param dto
     * @return
     */
    @GetMapping("/offline")
    public void offlineScore(CourseTotalScoreOfflineStudentQueryDTO dto, HttpServletResponse response) {
        courseTotalScoreOfflineService.downOfflineExcel(dto, response);
    }

}
